/*
 * @Description: voxel filter 模块
 * @Author: Zhijian Qiao
 * @Date: 2020-02-09 19:37:49
 */
#ifndef avp_slam_MODELS_CLOUD_FILTER_VOXEL_FILTER_HPP_
#define avp_slam_MODELS_CLOUD_FILTER_VOXEL_FILTER_HPP_

#include <pcl/filters/voxel_grid.h>
#include "cloud_filter_interface.hpp"

namespace avp_slam {
    class VoxelFilter : public CloudFilterInterface {
    public:
        VoxelFilter(const YAML::Node &node);

        VoxelFilter(float leaf_size_x, float leaf_size_y, float leaf_size_z);

        bool Filter(const CloudData::CLOUD_PTR &input_cloud_ptr, CloudData::CLOUD_PTR &filtered_cloud_ptr) override;

        bool RobustFilter(const CloudData::CLOUD_PTR &input_cloud_ptr, CloudData::CLOUD_PTR &filtered_cloud_ptr);

    private:
        bool SetFilterParam(float leaf_size_x, float leaf_size_y, float leaf_size_z);

    private:
        pcl::VoxelGrid<CloudData::POINT> voxel_filter_;
    };
}
#endif